package com.guigu.springboot.mapper;

import com.guigu.springboot.bean.Department;
import org.apache.ibatis.annotations.*;

/**
 * @author: kaiyi
 * @create: 2020-08-05 23:45
 */
public interface DepartmentMapper {

  @Select("select * from department where id=#{id}")
  public Department getDeptById(Integer id);

  @Delete("delete from department where id=#{id}")
  public int deleteDeptById(Integer id);

  @Options(useGeneratedKeys = true,keyProperty = "id")
  @Insert("insert into department(department_name) values(#{departmentName})")
  public int insertDept(Department department);

  @Update("update department set department_name=#{departmentName} where id=#{id}")
  public int updateDept(Department department);

}
